define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'com.flows/index',
        add_url: 'com.flows/add',
        edit_url: 'com.flows/edit',
        delete_url: 'com.flows/delete',
        export_url: 'com.flows/export',
        modify_url: 'com.flows/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'image', title: '头像', templet: ea.table.image},
                    {field: 'com_recipient', title: '佣金获得者'},
                    {field: 'com_type', title: '佣金类型'},
                    {field: 'com_amount', title: '所得佣金'},
                    {field: 'state', title: '0表示已发货，1表示已收货',templet: ea.table.switch},
                    {field: 'create_time', title: '结算时间'},
                    {field: 'status', title: '发货状态',search: 'select',selectList: {0: '待团长收货', 1: '用户已收货'}, templet: ea.table.switch},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});